﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using System.ComponentModel.DataAnnotations;

namespace Admin.NET.Application;

/// <summary>
/// 用户管理基础输入参数
/// </summary>
public class UserManagementBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 用户账号
    /// </summary>
    [Required(ErrorMessage = "用户账号不能为空")]
    public virtual string? UserAccounts { get; set; }
    
    /// <summary>
    /// 用户姓名
    /// </summary>
    [Required(ErrorMessage = "用户姓名不能为空")]
    public virtual string? UserName { get; set; }
    
    /// <summary>
    /// 性别
    /// </summary>
    [Required(ErrorMessage = "性别不能为空")]
    public virtual bool? UserSex { get; set; }
    
    /// <summary>
    /// 手机号
    /// </summary>
    [Required(ErrorMessage = "手机号不能为空")]
    public virtual string? UserPhone { get; set; }
    
    /// <summary>
    /// 岗位名称
    /// </summary>
    [Required(ErrorMessage = "岗位名称不能为空")]
    public virtual long? PostId { get; set; }
    
    /// <summary>
    /// 所在部门
    /// </summary>
    [Required(ErrorMessage = "所在部门不能为空")]
    public virtual long? DepartmentId { get; set; }
    
    /// <summary>
    /// 角色
    /// </summary>
    [Required(ErrorMessage = "角色不能为空")]
    public virtual long? RoleId { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    [Required(ErrorMessage = "状态不能为空")]
    public virtual bool? State { get; set; }
    
    /// <summary>
    /// 排序
    /// </summary>
    [Required(ErrorMessage = "排序不能为空")]
    public virtual int? Sort { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [Required(ErrorMessage = "备注不能为空")]
    public virtual string? Remark { get; set; }
    
}

/// <summary>
/// 用户管理分页查询输入参数
/// </summary>
public class PageUserManagementInput : BasePageInput
{
    /// <summary>
    /// 用户账号
    /// </summary>
    public string? UserAccounts { get; set; }
    
    /// <summary>
    /// 用户姓名
    /// </summary>
    public string? UserName { get; set; }
    
    /// <summary>
    /// 性别
    /// </summary>
    public bool? UserSex { get; set; }
    
    /// <summary>
    /// 手机号
    /// </summary>
    public string? UserPhone { get; set; }
    
    /// <summary>
    /// 岗位名称
    /// </summary>
    public long? PostId { get; set; }
    
    /// <summary>
    /// 所在部门
    /// </summary>
    public long? DepartmentId { get; set; }
    
    /// <summary>
    /// 角色
    /// </summary>
    public long? RoleId { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    public bool? State { get; set; }
    
    /// <summary>
    /// 排序
    /// </summary>
    public int? Sort { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public string? Remark { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 用户管理增加输入参数
/// </summary>
public class AddUserManagementInput
{
    /// <summary>
    /// 用户账号
    /// </summary>
    [Required(ErrorMessage = "用户账号不能为空")]
    [MaxLength(50, ErrorMessage = "用户账号字符长度不能超过50")]
    public string? UserAccounts { get; set; }
    
    /// <summary>
    /// 用户姓名
    /// </summary>
    [Required(ErrorMessage = "用户姓名不能为空")]
    [MaxLength(50, ErrorMessage = "用户姓名字符长度不能超过50")]
    public string? UserName { get; set; }
    
    /// <summary>
    /// 性别
    /// </summary>
    [Required(ErrorMessage = "性别不能为空")]
    public bool? UserSex { get; set; }
    
    /// <summary>
    /// 手机号
    /// </summary>
    [Required(ErrorMessage = "手机号不能为空")]
    [MaxLength(50, ErrorMessage = "手机号字符长度不能超过50")]
    public string? UserPhone { get; set; }
    
    /// <summary>
    /// 岗位名称
    /// </summary>
    [Required(ErrorMessage = "岗位名称不能为空")]
    public long? PostId { get; set; }
    
    /// <summary>
    /// 所在部门
    /// </summary>
    [Required(ErrorMessage = "所在部门不能为空")]
    public long? DepartmentId { get; set; }
    
    /// <summary>
    /// 角色
    /// </summary>
    [Required(ErrorMessage = "角色不能为空")]
    public long? RoleId { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    [Required(ErrorMessage = "状态不能为空")]
    public bool? State { get; set; }
    
    /// <summary>
    /// 排序
    /// </summary>
    [Required(ErrorMessage = "排序不能为空")]
    public int? Sort { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [Required(ErrorMessage = "备注不能为空")]
    [MaxLength(300, ErrorMessage = "备注字符长度不能超过300")]
    public string? Remark { get; set; }
    
}

/// <summary>
/// 用户管理删除输入参数
/// </summary>
public class DeleteUserManagementInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 用户管理更新输入参数
/// </summary>
public class UpdateUserManagementInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 用户账号
    /// </summary>    
    [Required(ErrorMessage = "用户账号不能为空")]
    [MaxLength(50, ErrorMessage = "用户账号字符长度不能超过50")]
    public string? UserAccounts { get; set; }
    
    /// <summary>
    /// 用户姓名
    /// </summary>    
    [Required(ErrorMessage = "用户姓名不能为空")]
    [MaxLength(50, ErrorMessage = "用户姓名字符长度不能超过50")]
    public string? UserName { get; set; }
    
    /// <summary>
    /// 性别
    /// </summary>    
    [Required(ErrorMessage = "性别不能为空")]
    public bool? UserSex { get; set; }
    
    /// <summary>
    /// 手机号
    /// </summary>    
    [Required(ErrorMessage = "手机号不能为空")]
    [MaxLength(50, ErrorMessage = "手机号字符长度不能超过50")]
    public string? UserPhone { get; set; }
    
    /// <summary>
    /// 岗位名称
    /// </summary>    
    [Required(ErrorMessage = "岗位名称不能为空")]
    public long? PostId { get; set; }
    
    /// <summary>
    /// 所在部门
    /// </summary>    
    [Required(ErrorMessage = "所在部门不能为空")]
    public long? DepartmentId { get; set; }
    
    /// <summary>
    /// 角色
    /// </summary>    
    [Required(ErrorMessage = "角色不能为空")]
    public long? RoleId { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>    
    [Required(ErrorMessage = "状态不能为空")]
    public bool? State { get; set; }
    
    /// <summary>
    /// 排序
    /// </summary>    
    [Required(ErrorMessage = "排序不能为空")]
    public int? Sort { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>    
    [Required(ErrorMessage = "备注不能为空")]
    [MaxLength(300, ErrorMessage = "备注字符长度不能超过300")]
    public string? Remark { get; set; }
    
}

/// <summary>
/// 用户管理主键查询输入参数
/// </summary>
public class QueryByIdUserManagementInput : DeleteUserManagementInput
{
}

/// <summary>
/// 下拉数据输入参数
/// </summary>
public class DropdownDataUserManagementInput
{
    /// <summary>
    /// 是否用于分页查询
    /// </summary>
    public bool FromPage { get; set; }
}

/// <summary>
/// 用户管理数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportUserManagementInput : BaseImportInput
{
    /// <summary>
    /// 用户账号
    /// </summary>
    [ImporterHeader(Name = "*用户账号")]
    [ExporterHeader("*用户账号", Format = "", Width = 25, IsBold = true)]
    public string? UserAccounts { get; set; }
    
    /// <summary>
    /// 用户姓名
    /// </summary>
    [ImporterHeader(Name = "*用户姓名")]
    [ExporterHeader("*用户姓名", Format = "", Width = 25, IsBold = true)]
    public string? UserName { get; set; }
    
    /// <summary>
    /// 性别
    /// </summary>
    [ImporterHeader(Name = "*性别")]
    [ExporterHeader("*性别", Format = "", Width = 25, IsBold = true)]
    public bool? UserSex { get; set; }
    
    /// <summary>
    /// 手机号
    /// </summary>
    [ImporterHeader(Name = "*手机号")]
    [ExporterHeader("*手机号", Format = "", Width = 25, IsBold = true)]
    public string? UserPhone { get; set; }
    
    /// <summary>
    /// 岗位名称 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? PostId { get; set; }
    
    /// <summary>
    /// 岗位名称 文本
    /// </summary>
    [ImporterHeader(Name = "*岗位名称")]
    [ExporterHeader("*岗位名称", Format = "", Width = 25, IsBold = true)]
    public string PostFkDisplayName { get; set; }
    
    /// <summary>
    /// 所在部门 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? DepartmentId { get; set; }
    
    /// <summary>
    /// 所在部门 文本
    /// </summary>
    [ImporterHeader(Name = "*所在部门")]
    [ExporterHeader("*所在部门", Format = "", Width = 25, IsBold = true)]
    public string DepartmentFkDisplayName { get; set; }
    
    /// <summary>
    /// 角色 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? RoleId { get; set; }
    
    /// <summary>
    /// 角色 文本
    /// </summary>
    [ImporterHeader(Name = "*角色")]
    [ExporterHeader("*角色", Format = "", Width = 25, IsBold = true)]
    public string RoleFkDisplayName { get; set; }
    
    /// <summary>
    /// 状态
    /// </summary>
    [ImporterHeader(Name = "*状态")]
    [ExporterHeader("*状态", Format = "", Width = 25, IsBold = true)]
    public bool? State { get; set; }
    
    /// <summary>
    /// 排序
    /// </summary>
    [ImporterHeader(Name = "*排序")]
    [ExporterHeader("*排序", Format = "", Width = 25, IsBold = true)]
    public int? Sort { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [ImporterHeader(Name = "*备注")]
    [ExporterHeader("*备注", Format = "", Width = 25, IsBold = true)]
    public string? Remark { get; set; }
    
}
